#tag Module
Protected Module sjgLogging
	#tag Method, Flags = &h0
		Sub Report(Text As String, Extra As String = "")
		  if not Active Then Return
		  
		  dim d As new date
		  dim lg As String = d.SQLDateTime + " -:- " + Text
		  if Extra <> ""then
		    lg = lg  + " -:- " + Extra
		  end if
		  System.DebugLog lg
		  if not ( efLocalLog is nil ) then
		    if efLocalLog isa EditField Then
		      EditField( efLocalLog ).AppendText EndOfLine + lg
		    ElseIf efLocalLog isa Listbox Then
		      Listbox( efLocalLog ).AddRow lg
		    end if
		  end if
		End Sub
	#tag EndMethod


	#tag Property, Flags = &h0
		Active As Boolean
	#tag EndProperty

	#tag Property, Flags = &h0
		efLocalLog As Rectcontrol
	#tag EndProperty

	#tag Property, Flags = &h0
		reportWindowEvents As Boolean
	#tag EndProperty


	#tag ViewBehavior
		#tag ViewProperty
			Name="Name"
			Visible=true
			Group="ID"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Index"
			Visible=true
			Group="ID"
			InitialValue="-2147483648"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Super"
			Visible=true
			Group="ID"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Left"
			Visible=true
			Group="Position"
			InitialValue="0"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Top"
			Visible=true
			Group="Position"
			InitialValue="0"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Active"
			Group="Behavior"
			InitialValue="0"
			Type="Boolean"
		#tag EndViewProperty
		#tag ViewProperty
			Name="reportWindowEvents"
			Group="Behavior"
			InitialValue="0"
			Type="Boolean"
		#tag EndViewProperty
	#tag EndViewBehavior
End Module
#tag EndModule
